<!doctype html>
<html>
<head>
    <include file="public/head"/>
    <title>添加视频</title>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:cmf_plugin_url('Aliyunvod://AdminIndex/index')}">视频管理</a></li>
        <li class="active"><a >添加视频</a></li>
        <li><a href="{:cmf_plugin_url('Aliyunvod://AdminVod/url')}">m3u8拉取</a></li>
        
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20 layui-form"
          action="{:cmf_plugin_url('Aliyunvod://AdminVod/main')}"  enctype="multipart/form-data">

        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>名称</label>
            <div class="col-md-6 col-sm-10">
                <input type="hidden" class="form-control" name="id" value="{$video.id|default=0}">
                <input type="text" class="form-control" name="title" id='title' value="{$video.title|default=''}">
            </div>
        </div>
        <div class="form-group layui-form-item">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>分类</label>
            <div class="col-md-6 col-sm-10 layui-input-block">
                <if condition="$is_edit eq 1">
                    <volist name='cate' id='vo' key='k'>
                        {$vo.cate_name} &nbsp;<input type="radio" name="category_id" value="{$vo.vod_cat_id}" title="{$vo.cate_name}" {$vo.vod_cat_id==$video['category_id']?'checked':''}> &nbsp;&nbsp;&nbsp;&nbsp;
                    </volist>
                    <else/>
                    <volist name='cate' id='vo' key='k'>
                        {$vo.cate_name} &nbsp;<input type="radio" name="category_id" value="{$vo.vod_cat_id}" title="{$vo.cate_name}" {$k==1?'checked':''}> &nbsp;&nbsp;&nbsp;&nbsp;
                    </volist>
                </if>
                
                  
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>mp4视频</label>
            <div class="col-md-6 col-sm-10">
                <input type="file" id="fileUpload" name="video" onchange="getFileName()">
            </div>
        </div>
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary">提  交</button>
        </div>
    </form>
</div>
<script type="text/javascript">
    function getFileName(){
        var name = $('#fileUpload').get(0).files[0].name.split('.')

        $("#title").attr('value',name[0])
    }
</script>
<include file="public/scripts"/>
</body>
</html>